<%@ page import="news.service.IQueryTopicService" %>
<%@ page import="news.service.QueryTopicServiceImpl" %>
<%@ page import="news.example.Topic" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<style>

    .title{
        font-size: 20px;
        font-weight: bold;
        margin-top: 25px;
    }
    .con{
        font-size: 18px;
        margin-top: 20px;
        font-weight: bold;
    }
    .con a{
        text-decoration: none;
        margin-left: 15px;
    }
    .con a:hover{
        color: lightskyblue;
    }
</style>

<%
    IQueryTopicService iQueryTopicService = new QueryTopicServiceImpl();
    List<Topic> list = iQueryTopicService.queryAllTopic();
    String topicName ="";
    int topic_id ;
%>
<div>
    <p class="title">编辑主题</p>
    <form method="post" action="updatetopic.jsp">
    <%
        for (int i = 0; i < list.size(); i++) {
            topicName = list.get(i).getTopicName();
            topic_id = list.get(i).getId();

    %>
    <p class="con">·
        <%
            out.println(topicName); %>
        <a href="main/maintopic-update.jsp?topic_id=<%=topic_id%>">编辑</a>
        <a href="./del.jsp?topic_id=<%=topic_id%>">删除</a>
    </p>
      <%
          }
      %>
    </form>
</div>
